home *** CD-ROM | disk | FTP | other *** search
/ User's Choice Windows CD / User's Choice Windows CD (CMS Software)(1993).iso / utility3 / wincap.zip / ERRORS.C < prev    next >
C/C++ Source or Header  |  1991-11-05  |  1KB  |  52 lines

  1. /*
  2.  * Errors.c
  3.  *
  4.  * Contains error messages for WINCAP
  5.  *
  6.  * These error messages all have constants associated with
  7.  * them, contained in errors.h.
  8.  *
  9.  * Note that not all these messages are used in WINCAP.
  10.  *
  11.  * Copyright (c) 1991 Microsoft Corporation. All rights reserved.
  12.  */
  13. #include <windows.h>
  14. #include "errors.h"
  15.  
  16. extern char szAppName[];
  17.  
  18. static char *szErrors[] =
  19. {
  20.    "Not a DIB file!",
  21.    "Couldn't allocate memory!",
  22.    "Error reading file!",
  23.    "Error locking memory!",
  24.    "Error opening file!",
  25.    "Error creating palette!",
  26.    "Error getting a DC!",
  27.    "Error creating Device Dependent Bitmap",
  28.    "StretchBlt() failed!",
  29.    "StretchDIBits() failed!",
  30.    "SetDIBitsToDevice() failed!",
  31.    "Printer: StartDoc failed!",
  32.    "Printing: GetModuleHandle() couldn't find GDI!",
  33.    "Printer: SetAbortProc failed!",
  34.    "Printer: StartPage failed!",
  35.    "Printer: NEWFRAME failed!",
  36.    "Printer: EndPage failed!",
  37.    "Printer: EndDoc failed!",
  38.    "SetDIBits() failed!",
  39.    "File Not Found!",
  40.    "Invalid Handle",
  41.    "General Error on call to DIB function"
  42. };
  43.  
  44.  
  45. void DIBError(int ErrNo)
  46. {
  47.    if ((ErrNo < ERR_MIN) || (ErrNo >= ERR_MAX))
  48.       MessageBox(NULL, "Undefined Error!", szAppName, MB_OK | MB_ICONHAND);
  49.    else
  50.       MessageBox(NULL, szErrors[ErrNo], szAppName, MB_OK | MB_ICONHAND);
  51. }
  52.